const router = require('express').Router();
const { create, getById, getAll, update, remove } = require('../controllers/commentController');
const authMiddleware = require('../middlewares/authMiddleware');

// 创建新评论
router.post('/', authMiddleware, create);
// 根据ID获取评论
router.get('/:zpid', authMiddleware, getById);
// 获取所有评论
router.get('/', authMiddleware, getAll);
// 更新评论
router.put('/:id', authMiddleware, update);
// 删除评论
router.delete('/:id', authMiddleware, remove);

module.exports = router;